package com.learn.designPatterns.behavioral.vistor;

/**
 * @classname:
 * @Description:
 * @author: yfpu
 * @Date: 2018-10-26 15:31
 */
public class Client {

    public static void main(String[] args) {
        Customer customer1 = new Customer("customer1");
        customer1.addOrder(new Order("order1", "items1"));
        customer1.addOrder(new Order("order2", "items2"));
        customer1.addOrder(new Order("order3", "items3"));


        Order order = new Order("order_a");
        order.addItem(new Item("item_a1"));
        order.addItem(new Item("item_a2"));
        order.addItem(new Item("item_a3"));
        Customer customer2 = new Customer("customer2");
        customer2.addOrder(order);


        CustomerGroup customerGroup = new CustomerGroup();
        customerGroup.addCustomer(customer1);
        customerGroup.addCustomer(customer2);


        GeneralReport generalReport = new GeneralReport();
        customerGroup.accept(generalReport);
        generalReport.displayResults();

    }
}
